package ygg.encoding.swf.tag.codec
{
	import j.sus2maj7.encoding.*;
	import j.sus2maj7.context.*;
	
	import ygg.encoding.swf.tag.*;
	import ygg.encoding.swf.tag.object.*;
	
	public class DefineBinaryDataCodec extends TagCodec
	{
		public function DefineBinaryDataCodec()
		{
			super();
		}
		
		override public function decode(binary:IBinary, context:IContext=null):*
		{
			var retVal:DefineBinaryData = new DefineBinaryData();
			var b:TagBinary = binary as TagBinary;
			b.position = 0;
			b.syncBits();
			
			retVal.tagId = b.readU16();
			b.readInt(); //reserved
			
			retVal.data = new TagBinary();
			b.readBytes(retVal.data.ba);
			return retVal;
		}
		
		override public function encode(o:*, context:IContext=null):IBinary
		{
			var b:TagBinary = new TagBinary();
			var obj:DefineBinaryData = o as DefineBinaryData;
			
			
			
			return b;
		}
	}
}